-
Notifications
You must be signed in to change notification settings - Fork 9.4k
magento/magento2#39905 Product Removed on Mobile Still Appears in Web's Mini Compare Section Until Re-login #40023
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
magento/magento2#39905 Product Removed on Mobile Still Appears in Web's Mini Compare Section Until Re-login #40023
Conversation
…ompare Section Until Re-login Integrates the Product Compare helper across compare list resolvers to trigger updates after adding, removing, or creating compare lists. Also forces a reload of compare product data on the frontend to maintain accuracy.
|
Hi @KrasnoshchokBohdan. Thank you for your contribution!
Allowed build names are:
You can find more information about the builds here For more details, review the Code Contributions documentation. |
|
@magento run all tests |
Den4ik
left a comment
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Hi @KrasnoshchokBohdan
Thanks for your PR.
Could you please fix static tests and add new tests for fixed issue?
Thanks
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@Den4ik Hi!
Sorry to bother you. I probably should have marked this as a draft immediately.
Currently, I'm struggling with a solution for reloading the compare-product customer section after changes made by a GraphQL mutation (
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Hi @KrasnoshchokBohdan
Thanks for details
…ompare Section Until Re-login Introduced CompareCookieManager to manage cookie invalidation for compare list products. Updated resolvers to use this service and ensure cookies are marked invalid after product compare list operations. Removed redundant client-side cookie reload logic in the frontend.
|
@magento run all tests |
|
@magento run all tests |
…ompare Section Until Re-login Introduced `CompareCookieManager` enhancements with better cookie management through visibility modifiers and documentation changes. Suppressed warnings for PHPMD where relevant and added comprehensive unit tests for cookie handling, including edge cases like size limits and failures.
|
@magento run all tests |
…ompare Section Until Re-login - Static tests fix
|
@magento run all tests |
|
@magento run Unit Tests |
|
@Den4ik, the only solution I found for now is to change compare-products cookie, so if you have any comments or suggestions, I will be happy to consider them |
|
Hi @KrasnoshchokBohdan |
…ompare Section Until Re-login Refactor CompareCookieManager to use readonly properties Replaced manually assigned properties with readonly properties in the constructor to simplify initialization and improve immutability. Updated exception handling to use the imported Exception class instead of a fully qualified name.
|
@magento run all tests |
|
@magento run all tests |
engcom-Hotel
left a comment
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Failed tests seems to flaky, hence approving the PR.
|
@magento run all tests |
|
@magento run Functional Tests B2B, Functional Tests CE, Functional Tests EE, Unit Tests |
|
@magento run Functional Tests B2B |
8aa02bb
into
magento:2.4-develop






Description (*)
createCompareList
addProductsToCompareList
removeProductsFromCompareList
After these mutations, the counter in the header and in the customer account does not change. I found \Magento\Catalog\Helper\Product\Compare::calculate, which updates the quantity in _catalogSession, but the counters actually get their data from the customer data (compare-products section). To get an accurate quantity, the session needs to be updated, which is quite contradictory when considering the issue in the GraphQL scope.
Related Pull Requests
Fixed Issues (if relevant)
Manual testing scenarios (*)
Questions or comments
Contribution checklist (*)